package repository

import (
	"ai/internal/db/dao"
	"ai/internal/db/models"
)

type ActivityRepository struct {
	dao *dao.ActivityDAO
}

func NewActivityRepository(activityDAO *dao.ActivityDAO) *ActivityRepository {
	return &ActivityRepository{dao: activityDAO}
}

// CreateActivity adds a new activity to the database
func (repo *ActivityRepository) CreateActivity(activity *models.Activity) error {
	return repo.dao.CreateActivity(activity)
}

// AddToWrongSet adds a question to the user's wrong set
func (repo *ActivityRepository) AddToWrongSet(wrongSet *models.WrongSet) error {
	return repo.dao.AddToWrongSet(wrongSet)
}

// GetWrongSetByUser retrieves the wrong set for a specific user
func (repo *ActivityRepository) GetWrongSetByUser(userID uint) ([]models.WrongSet, error) {
	return repo.dao.GetWrongSetByUser(userID)
}

// ResolveWrongQuestion resolves a wrong question for a user
func (repo *ActivityRepository) ResolveWrongQuestion(userID, questionID uint) error {
	return repo.dao.ResolveWrongQuestion(userID, questionID)
}

// UpdateQuestionStatus updates the status of a question for a user
func (repo *ActivityRepository) UpdateQuestionStatus(userID, questionID uint, status models.QuestionStatus) error {
	return repo.dao.UpdateQuestionStatus(userID, questionID, status)
}

// GetQuestionsByStatus retrieves questions by their status for a user
func (repo *ActivityRepository) GetQuestionsByStatus(userID uint, status models.QuestionStatus) ([]models.Question, error) {
	return repo.dao.GetQuestionsByStatus(userID, status)
}

// Add methods for ActivityRepository as needed
